//
// Created by 李梦凡 on 2019/10/21.
//

#ifndef GAME_OBJECT_H
#define GAME_OBJECT_H

#include <glad.h>
#include <glm.hpp>

#include "texture2d.h"
#include "sprite_renderer.h"


// Container object for holding all state relevant for a single
// game object entity. Each object in the game likely needs the
// minimal of state as described within GameObject.
class GameObject {
public:
    // Object state
    glm::vec2 Position, Size, Velocity;
    glm::vec3 Color;
    GLfloat Rotation;
    GLboolean IsSolid;
    GLboolean Destroyed;
    // Render state
    Texture2D Sprite;

    // Constructor(s)
    GameObject();

    GameObject(glm::vec2 pos, glm::vec2 size, Texture2D sprite, glm::vec3 color = glm::vec3(1.0f),
               glm::vec2 velocity = glm::vec2(0.0f, 0.0f));

    // Draw sprite
    virtual void Draw(SpriteRenderer &renderer);
};

#endif
